package com.tisson.bo;

import java.util.ArrayList;
import java.util.List;

import com.tisson.dao.AcRightDAO;
import com.tisson.pojo.AcRight;

public class AcRightBO {
	
	private AcRightDAO acRightDAO = new AcRightDAO();

	public List getDIDByUID(String userId){
		return new ArrayList();
	}
	
	public List getUIDByDID(String doorId){
		try{
			List userIdList = new ArrayList();
			List rightList = acRightDAO.findAll();
			for(int i=0;i<rightList.size();i++){
				AcRight acRight =(AcRight)rightList.get(i);
				if(acRight.getDoorId().equals(doorId)){
					userIdList.add(acRight.getUserId());
				}
			}
			return userIdList;
		}catch(Exception e){
			return new ArrayList();
		}
	}
}
